//
//  FSDevice.m
//  bleDemo
//
//  Created by zt on 2020/5/16.
//  Copyright © 2020 XB. All rights reserved.
//

#import "FSDevice.h"

@implementation FSDevice

- (instancetype)initWithDevice:(BleDevice *)device {
    if (self = [super init]) {
        self.filterServices = device.filterServices;
        [self setValue:device.name forKey:@"name"];
        [self setValue:device.RSSI forKey:@"RSSI"];
        [self setValue:device.advertisementData forKey:@"advertisementData"];
        [self setValue:device.peripheral forKey:@"peripheral"];
        self.delegate = self;
        [self setValue:@(device.connected) forKey:@"connected"];
        [self setValue:@(device.connectCount) forKey:@"connectCount"];
        [self setValue:@(device.connecting) forKey:@"connecting"];
    }
    return self;;
}

@end
